package com.ruoyi.project.system.domain;

import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 支付对象 sm_pay
 */
public class SmPay extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    private Integer id;

    /**
     * 类型
     */
    @Excel(name = "类型")
    private String type;

    /**
     * 用户ID
     */
    @Excel(name = "用户ID")
    private Integer userId;

    /**
     * 外部单号
     */
    @Excel(name = "外部单号")
    private Integer outId;

    /**
     * 系统支付单号
     */
    @Excel(name = "系统支付单号")
    private String orderNo;

    /**
     * 商品标题
     */
    @Excel(name = "商品标题")
    private String subject;

    /**
     * 请求支付金额
     */
    @Excel(name = "请求支付金额")
    private BigDecimal pricing;

    /**
     * 实际支付金额
     */
    @Excel(name = "实际支付金额")
    private BigDecimal actualPayAmount;

    /**
     * 支付平台生订单号
     */
    @Excel(name = "支付平台生订单号")
    private String platformOrderNo;

    /**
     * 支付方式
     */
    @Excel(name = "支付方式")
    private String payType;

    /**
     * 支付状态
     */
    @Excel(name = "支付状态")
    private String payState;

    /**
     * 付款时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "付款时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date payTime;

    /**
     * 删除标志
     */
    @Excel(name = "删除标志")
    private String delSign;

    public SmPay() {
    }

    public SmPay(Integer id, String payState) {
        this.id = id;
        this.payState = payState;
    }

    public SmPay(Integer id, BigDecimal actualPayAmount, String platformOrderNo, String payState, Date payTime) {
        this.id = id;
        this.actualPayAmount = actualPayAmount;
        this.platformOrderNo = platformOrderNo;
        this.payState = payState;
        this.payTime = payTime;
    }

    public SmPay(int outId, BigDecimal pricing, Integer userId, String payType, String subject) {
        this.outId = outId;
        this.pricing = pricing;
        this.type = "query";
        this.userId = userId;
        this.orderNo = IdUtils.fastSimpleUUID().substring(0, 8).toUpperCase();
        this.subject = subject;
        this.payType = payType;
    }

    public SmPay(BigDecimal pricing, Integer userId, String payType, String remark) {
        this.pricing = pricing;
        this.type = "upgrade";
        this.userId = userId;
        this.orderNo = IdUtils.fastSimpleUUID().substring(0, 8).toUpperCase();
        this.subject = "用户升级";
        this.payType = payType;
        this.setRemark(remark);
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setOutId(Integer outId) {
        this.outId = outId;
    }

    public Integer getOutId() {
        return outId;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getSubject() {
        return subject;
    }

    public void setPricing(BigDecimal pricing) {
        this.pricing = pricing;
    }

    public BigDecimal getPricing() {
        return pricing;
    }

    public void setActualPayAmount(BigDecimal actualPayAmount) {
        this.actualPayAmount = actualPayAmount;
    }

    public BigDecimal getActualPayAmount() {
        return actualPayAmount;
    }

    public void setPlatformOrderNo(String platformOrderNo) {
        this.platformOrderNo = platformOrderNo;
    }

    public String getPlatformOrderNo() {
        return platformOrderNo;
    }

    public void setPayType(String payType) {
        this.payType = payType;
    }

    public String getPayType() {
        return payType;
    }

    public void setPayState(String payState) {
        this.payState = payState;
    }

    public String getPayState() {
        return payState;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setDelSign(String delSign) {
        this.delSign = delSign;
    }

    public String getDelSign() {
        return delSign;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("type", getType())
                .append("userId", getUserId())
                .append("outId", getOutId())
                .append("orderNo", getOrderNo())
                .append("subject", getSubject())
                .append("pricing", getPricing())
                .append("actualPayAmount", getActualPayAmount())
                .append("platformOrderNo", getPlatformOrderNo())
                .append("payType", getPayType())
                .append("payState", getPayState())
                .append("payTime", getPayTime())
                .append("delSign", getDelSign())
                .append("remark", getRemark())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
